package com.xiaotu.mapper;

import com.xiaotu.pojo.Authority;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AuthorityRepository extends JpaRepository<Authority,Integer> {
    @Query(nativeQuery = true,value = " select a.authority authority , a.id id from t_customer c,t_authority a,t_customer_authority ca where c.id = ca.customer_id and a.id = ca.authority_id and c.username = ?1")
    public List<Authority> findAuthoritiesByUsername(String username);
}
